<template>
	<van-swipe :autoplay="3000" style="height: 100%;margin-top: 0.5rem; border-radius: 0.35rem;">
		<van-swipe-item v-for="(item,i) in carouselItems" :key="i" >
			<router-link :to="{name:'productDetail',params:{id:item.product_id}}">
				<van-image width="100%" :src="APIDomainName + item.img"></van-image>
			</router-link>
		</van-swipe-item>
	</van-swipe>

</template>

<script>
	// 导入封装后的首页接口
	import {
		getHomeListAPI
	} from '@/api/home.js';
	export default {
		name: 'homeSwipe',
		props: {
			carouselItems: Array,
		},

		methods: {
			onDetail(id) {
				this.$router.push({
					name: 'productDetail',
					params: {
						id
					}
				})
			}
		}
	}
</script>
<style>
	.van-swipe__indicator .van-swipe__indicator--active {
	    background-color: #65a15a;
	    opacity: 1;
	}
</style>
